<?php if (!defined('THINK_PATH')) exit();?>		<div class="table-responsive">
						 <form action="/Admin/Comment/operate" method="post" id="operate_form">	
							<table class="table table-bordered table-hover"
								id="categoryTable">
								<thead>
									<tr class="active">
									<th><input onclick="choosebox(this)" type="checkbox" /></th>
									<th height="40">编号</th>
									<th>用户名</th>
									<th>类型</th>
									<th>评论对象</th>
									<th>ip地址</th>
									<th  width="10%">评论时间</th>
									<th>是否显示</th>
									<th width="100">操作</th>
									</tr>
								</thead>
								<tbody>
									<?php if(is_array($comment)): foreach($comment as $key=>$comment): ?><tr>
									<td><input type="checkbox" name="comment_id[]" value="<?php echo ($comment['id']); ?>" /></td>
									<td><?php echo ($comment['id']); ?></td>
									<td><?php echo ($comment['user_name']); ?></td>
									<td>
										<?php switch($comment['comment_type']): case "1": ?>活动<?php break;?>
										    <?php case "2": ?>预约<?php break; endswitch;?>
									</td>
									<td><?php echo ($comment['id_value']); ?></td>
									<td><?php echo ($comment['ip_address']); ?></td>
									<td><?php echo (date("Y-m-d H:i:s",$comment['add_time'])); ?></td>
									<td>
										 <?php switch($comment['status']): case "1": ?>是<?php break;?>
										    <?php case "0": ?>否<?php break; endswitch;?>
									</td>
									
										<td class="center">
										<!-- <button class="btn btn-white btn-sm" data-toggle="tooltip" data-placement="top" title="标为垃圾邮件"><i class="fa fa-trash-o"></i>
                       					 </button> -->
											 <div class="dropdown">
												<button class="btn btn-primary dropdown-toggle"
													type="button" id="dropdownMenu1" data-toggle="dropdown"
													aria-haspopup="true" aria-expanded="true">
													操作
													<span class="caret"></span>
												</button>
												<ul class="dropdown-menu" style="min-width: 90px;" aria-labelledby="dropdownMenu1">
													<li>
														<?php if($comment['comment_type'] == 1): ?><a role="button" class="btn btn-primary"
														   style="margin-bottom: 0px;"
														   href="/Admin/Comment/detail?id=<?php echo ($comment['id']); ?>">
															<span class="fa fa-edit"></span>
															查看
														</a>
														<?php else: ?>
														<a href="/Admin/Comment/make_detail?id=<?php echo ($comment['id']); ?>" class="btn btn-primary"
														   style="margin-bottom: 0px;">
															<span class="fa fa-edit"></span>
															查看
														</a><?php endif; ?>
													</li>
													<li>
														<a role="button" class="btn btn-danger"
															style="margin-bottom: 0px;"
															onclick="deleteComment(this,<?php echo ($comment['id']); ?>)" href="javascript:void(0);">
															<span class="fa fa-trash-o"></span>
															删除
														</a>
													</li>
												</ul>
											</div> 
										</td>
									</tr><?php endforeach; endif; ?>
								</tbody>
							 	<!-- <tfoot>
                                <tr>
                               		<td colspan="3" class="footable-visible">
                               		<select name="type" class="input-sm form-control pull-left" style="width:100px;margin-right: 5px;">
													 	<option value="">活动类型</option>
				                                        <option value="show">显示</option>
				                                        <option value="hide">隐藏</option>
				                                        <option value="del">删除</option>
				                     </select>
				                     <button tpye="submit" class="btn btn-primary pull-left"> 确认</button>
                                    </td>
                                    <td colspan="6" class="footable-visible">
                                     <ul class="pagination  pull-right">
								    <?php echo ($page); ?>
								  </ul>
                                    </td>
                                </tr>
                                </tfoot>  -->
							</table>
							
							 <div class="col-sm-12" style="padding:0px;">
								<div class="col-sm-4" style="padding-left:0px;"> 
									<select name="operate" class="input-sm form-control pull-left" style="width:100px;margin-right: 5px;">
													 	<option value="0">选择操作</option>
				                                        <option value="show">显示</option>
				                                        <option value="hide">隐藏</option>
				                                        <option value="del">删除</option>
				                     </select>
				                     <button tpye="submit"  class="btn btn-primary pull-left"> 确认</button>
			                    </div>
								<div class="col-sm-8" style="padding:0px;">
								  <ul class="pagination  pull-right">
								    <?php echo ($page); ?>
								  </ul>
								</div>
							</div>	 
							 </form> 
						</div>
<script>
    $(".pagination  a").click(function(){
        var page = $(this).data('p');
        ajax_get_table('search-form2',page);
    });
    
    //操作
    $('#operate_form').submit(function(){
    	var op_type = $("select[name='operate']").val();
        if(op_type == 0){
    		layer.msg('请选择操作', {time: 1000});   //alert('请选择操作');
            return false;
        }
        var selected = $("input[name='comment_id[]']:checked");
        if(selected.length < 1){
    		layer.msg('请选择记录', {time: 1000}); //            alert('请选择项目');
    		return false;
        }
        
    });
    function view(obj,content){
        alert(content);
    };
</script>